package com.nulldev.util.encoding.nHash.other;

import com.nulldev.util.encoding.nHash.Hashable;
import com.nulldev.util.string.StringsUtil;

public class CRC32 implements Hashable<String> {

	@Override
	public String hash(byte[] data) {
		final java.util.zip.CRC32 crc = new java.util.zip.CRC32();
		crc.update(data);
		return Long.toHexString(crc.getValue());
	}

	@Override
	public String hasherID() {
		return "jdk.crc32";
	}

	@Override
	public String[] hashes() {
		return new String[] {"CRC32", "CRC"};
	}

}
